package com.my12306.user.model.po;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * 文章收藏表
 *
 * @Author:苏牧夕
 * @Date:2020-05-15 17:36:13
 * @Version 1.0
 */
@TableName("p_praise")
public class PraiseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 点赞id
     */
    @TableId
    private Long id;
    /**
     * 用户id
     */
    private Long userId;
    /**
     * 点赞内容id（可能是文章可能是视频）
     */
    private Long valueId;
    /**
     * 收藏类型：0-文章 1-评论  2-视频 3-健康
     */
    private Integer praiseType;
    /**
     * 逻辑删除 0-表示删除，1-表示正常
     */
    private Integer logicDelete;
    /**
     * 状态 0-表示禁用 1-表示正常
     */
    private Integer showStatus;
    /**
     * 创建时间
     */
    private Date createDate;
    /**
     * 修改时间
     */
    private Date updateDate;
    /**
     * 版本号
     */
    private Integer version;

    public PraiseEntity() {
    }

    public PraiseEntity(Long id, Long userId, Long valueId, Integer praiseType, Integer logicDelete, Integer showStatus, Date createDate, Date updateDate, Integer version) {
        this.id = id;
        this.userId = userId;
        this.valueId = valueId;
        this.praiseType = praiseType;
        this.logicDelete = logicDelete;
        this.showStatus = showStatus;
        this.createDate = createDate;
        this.updateDate = updateDate;
        this.version = version;
    }

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof PraiseEntity)) return false;
        PraiseEntity that = (PraiseEntity) o;
        return Objects.equals(getId(), that.getId()) &&
                Objects.equals(getUserId(), that.getUserId()) &&
                Objects.equals(getValueId(), that.getValueId()) &&
                Objects.equals(getPraiseType(), that.getPraiseType()) &&
                Objects.equals(getLogicDelete(), that.getLogicDelete()) &&
                Objects.equals(getShowStatus(), that.getShowStatus()) &&
                Objects.equals(getCreateDate(), that.getCreateDate()) &&
                Objects.equals(getUpdateDate(), that.getUpdateDate()) &&
                Objects.equals(getVersion(), that.getVersion());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getUserId(), getValueId(), getPraiseType(), getLogicDelete(), getShowStatus(), getCreateDate(), getUpdateDate(), getVersion());
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getValueId() {
        return valueId;
    }

    public void setValueId(Long valueId) {
        this.valueId = valueId;
    }

    public Integer getPraiseType() {
        return praiseType;
    }

    public void setPraiseType(Integer praiseType) {
        this.praiseType = praiseType;
    }

    public Integer getLogicDelete() {
        return logicDelete;
    }

    public void setLogicDelete(Integer logicDelete) {
        this.logicDelete = logicDelete;
    }

    public Integer getShowStatus() {
        return showStatus;
    }

    public void setShowStatus(Integer showStatus) {
        this.showStatus = showStatus;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public Integer getVersion() {
        return version;
    }

    public void setVersion(Integer version) {
        this.version = version;
    }
}
